﻿using System;
using Natural.Attributes;
using Natural.Helpers;

namespace Natural.Providers
{ 
    public sealed class Serializer
    {
        public static T Deserialize<T>(string input)
        {
            return Manager.Deserialize<T>(input);
        }
        public static object Deserialize(string input, Type targetType)
        {
            return Manager.Deserialize(input,targetType);
        }
        public static object DeserializeObject(string input)
        {
            return Manager.DeserializeObject(input);
        }
        public static string Serialize(object obj)
        {
            return Manager.Serialize(obj);
        }

        private static ISerializer Manager
        {
            get { return Solver.Solve("Serializer") as ISerializer; }
        }
    }
}
